package cn.icatw.yygh.common.exception;

import cn.icatw.yygh.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 测试自定义全局异常类
 *
 * @author 76218
 */

@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(YyghException.class)
    public Result error(YyghException e) {
        e.printStackTrace();
        return Result.fail();
    }
}
